import Vue from 'vue'
import App from './App.vue'
import "./style/reset.less"
//8、引入封装路由的js
import router from "./router/index"
Vue.config.productionTip = false

import { Cell, CellGroup, Form, Field, Button, Toast, NavBar } from 'vant';

Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
Vue.use(Toast);
Vue.use(Button);
Vue.use(Form);
Vue.use(Field);

import axios from './utils/request'
Vue.filter("joinPath", function (val) {
  //如果传回来的元素找不到或没有http则    axios.defaults.baseURL+val  拼接
  if (val && val.indexOf("http") === -1) {
    return axios.defaults.baseURL + val
  } else {
    return val
  }
}
)

new Vue({
  //9、把路由对象注入到vue实例中
  router,
  render: h => h(App),
}).$mount('#app')
